using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class web_pages_MasterDefault : System.Web.UI.MasterPage
{
    public string id = "", act = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        ContentPlaceHolder_Defualt_top_banner.Controls.Add(new UserControl().LoadControl("~/web/Controls/Ctrl_vl_top_sub_banner.ascx"));
        if ((Session["NTV_user"] == null))
        {
            Session.Remove("sNTV");
            Session.Remove("NTV_user");
            Session.Remove("NTV_id");
            Session.Remove("NTV_active");
			Session.Remove("home");

            Session.Add("urlNTV", Request.RawUrl.ToString());
            Response.Redirect("~/web/pages/nguoitimviec.aspx");
        }
        else
        {
			Session.Add("home", "0");
            if (!string.IsNullOrEmpty(Request.Params["id"])) id = Request.Params["id"];
            if (!string.IsNullOrEmpty(Request.Params["act"])) act = Request.Params["act"];
            if (Request.Params["page"] != null)
            {
                switch (Request.Params["page"])
                {
                    case "ntv_chitiet":
                        ContentPlaceHolder1.Controls.Add(new UserControl().LoadControl("~/web/Controls/ctrl_vl_left_ntv_details.ascx"));
                        break;
                    case "vtn_chitiet":
                        ContentPlaceHolder1.Controls.Add(new UserControl().LoadControl("~/web/Controls/ctrl_vl_left_vtn_details.ascx"));
                        break;
                    case "hosodatao":
                        ContentPlaceHolder1.Controls.Add(new UserControl().LoadControl("~/web/Controls/nguoitimviec_hosodatao.ascx"));
                        break;
                    case "vieclamtrong":
                        ContentPlaceHolder1.Controls.Add(new UserControl().LoadControl("~/web/Controls/ctrl_vl_left_vtn_details.ascx"));
                        break;
                    case "tuyendungluu":
                        ContentPlaceHolder1.Controls.Add(new UserControl().LoadControl("~/web/Controls/nguoitimviec_tuyendungdaluu.ascx"));
                        break;
                    case "tuyendungmoi":
                        ContentPlaceHolder1.Controls.Add(new UserControl().LoadControl("~/web/Controls/nguoitimviec_tuyendungduocmoi.ascx"));
                        break;
                    case "tuyendungnop":
                        if (act == "delnop")
                        {
                            ContentPlaceHolder1.Controls.Add(new UserControl().LoadControl("~/web/Controls/nguoitimviec_tuyendungdanop.ascx"));
                        }
                        else
                        {
                            ContentPlaceHolder1.Controls.Add(new UserControl().LoadControl("~/web/Controls/nguoitimviec_tuyendungdanop.ascx"));
                        }
                        break;
                    default:
                        ContentPlaceHolder1.Controls.Add(new UserControl().LoadControl("~/web/Controls/nguoitimviec_hosodatao.ascx"));
                        break;
                }
            }
        }
    }
}
